<?php 
set_time_limit(0);
include("config.php");
$cid=$_GET['cid']?$_GET['cid']:'0';
$page = !($_GET['page'])?'1':intval($_GET['page']);
if($cid){
	$add=" and s_cid='".$cid."'";
}else{
	$add="";
}
$cat=mysql_query("select s_name from ".$prefix."shopcat where s_cid=".$cid);
if($a=mysql_fetch_array($cat)){
	$thistitle=$a['s_name']."_皇冠店铺排行";
}else{
	$thistitle="皇冠店铺排行";
}

$prefixurl="huangguandianpu";

include("head.php");

$result=mysql_query("select * from ".$prefix."shoplist where s_level >=11".$add." order by s_level desc limit ".(($page-1)*25).",25");
while($arr=mysql_fetch_array($result)){
	$arr['s_clickurl'] = base64_encode(str_replace('mm_15252835_0_0',$userpid,$arr['s_clickurl']));
	if($arr['s_collect']==0){$arr['s_collect']= "∞";}
	$cat=mysql_query("select s_name from ".$prefix."shopcat where s_cid=".$arr['s_cid']);
	if($a=mysql_fetch_array($cat)){
		$arr['catname'] = $a['s_name'];
	}
	$shoplist[]=$arr;
}

$total=mysql_query("select * from ".$prefix."shoplist where s_level >=11".$add);
$totalResults=mysql_num_rows($total);
require_once("pages.php");    
  $page_size=20;    
  $nums=$totalResults;     
  $sub_pages=10;   
  $pageCurrent=$_GET["page"];         
  $subPages=new SubPages($page_size,$nums,$pageCurrent,$sub_pages,$website."/huangguandianpu".$ljoin.$lcat.$cid.$ljoin.$lpage,2,$rewrite_postfix);
  $pagestr=$subPages->getstr();
include("foot.php");
$cache=false;
$smar=new MySmarty($cache,$cachetime,$moban);
$smarty=$smar->get_smarty();
//head
$smarty->assign("thistitle",$thistitle);
$smarty->assign("q",$q);
$smarty->assign("result2",$result2);
$smarty->assign("webname",$webname);
$smarty->assign("postfix",$postfix);
$smarty->assign("description",$description);
$smarty->assign("keywords",$keywords);
$smarty->assign("website",$website);
$smarty->assign("searchkeys",$searchkeys);
$smarty->assign("newshops",$newshops);
$smarty->assign("toubiao",$show_topnav);
$smarty->assign("moban",$moban);
$smarty->assign("thispid",$thispid);


//category
$smarty->assign("prefixurl",$prefixurl);
$smarty->assign("lcat",$lcat);
$smarty->assign("lpro",$lpro);
$smarty->assign("lpage",$lpage);
$smarty->assign("rewrite_postfix",$rewrite_postfix);
$smarty->assign("ljoin",$ljoin);
//foot
$smarty->assign("links",$links);
$smarty->assign("QQ",$QQ);
$smarty->assign("ICP",$ICP);
$smarty->assign("tongji",$tongji);
$smarty->assign("jiathis",$jiathis);
//slist
$smarty->assign("shoplist",$shoplist);
$smarty->assign("subPages",$pagestr);


$smarty->display("hlist.html");
?>

